-- GENERATED SPELL FOR [Demolitionist Legoso] --


function spell0_17982(pUnit, Event) --@Frost Shock,n/a--
pUnit:FullCastSpellOnTarget(8056,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17982', 8000, 1)
end

function spell1_17982(pUnit, Event) --@Healing Wave,Heal--
pUnit:FullCastSpellOnTarget(913,pUnit)
pUnit:RegisterEvent('Sorts_17982', 3000, 1)
end

function spell2_17982(pUnit, Event) --@Lesser Healing Wave,Heal--
pUnit:FullCastSpellOnTarget(8004,pUnit)
pUnit:RegisterEvent('Sorts_17982', 1500, 1)
end

function spell3_17982(pUnit, Event) --@Lightning Shield,Self--
pUnit:FullCastSpellOnTarget(325,pUnit)
pUnit:RegisterEvent('Sorts_17982', 628, 1)
end

function spell4_17982(pUnit, Event) --@Searing Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(38116,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_17982', 1, 1)
end

function spell5_17982(pUnit, Event) --@Strength of Earth Totem,Self--
pUnit:FullCastSpellOnTarget(31633,pUnit)
pUnit:RegisterEvent('Sorts_17982', 573, 1)
end

function Sorts_17982(pUnit, Event)
local choix_sorts_17982 = math.random(0, 5)
if choix_sorts_17982 == 0 then
pUnit:RegisterEvent('spell0_17982', 1, 1)
end
if choix_sorts_17982 == 1 then
pUnit:RegisterEvent('spell1_17982', 1, 1)
end
if choix_sorts_17982 == 2 then
pUnit:RegisterEvent('spell2_17982', 1, 1)
end
if choix_sorts_17982 == 3 then
pUnit:RegisterEvent('spell3_17982', 1, 1)
end
if choix_sorts_17982 == 4 then
pUnit:RegisterEvent('spell4_17982', 1, 1)
end
if choix_sorts_17982 == 5 then
pUnit:RegisterEvent('spell5_17982', 1, 1)
end
end

function mob17982_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_17982', math.random(1500, 3000), 1)
end

function mob17982_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17982_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17982_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(17982, 1, 'mob17982_Action')
RegisterUnitEvent(17982, 2, 'mob17982_Leave')
RegisterUnitEvent(17982, 3, 'mob17982_Kill')
RegisterUnitEvent(17982, 4, 'mob17982_Die')
